Skip to content

Raise ArgumentError for an unknown CSV converter name - #405

Open
adityawrk wants to merge 1 commit into
ruby:mainfrom
adityawrk:fix/unknown-converter
Open

adityawrk wants to merge 1 commit into
ruby:mainfrom
adityawrk:fix/unknown-converter

Conversation

@adityawrk

@adityawrk adityawrk commented Nov 29, 2026 •

Copy link
Copy Markdown

Fixes #386.

An unknown converters: or header_converters: name, and an unknown name passed to CSV#convert or CSV#header_convert, was stored as nil. The first converted field then failed with NoMethodError: undefined method 'arity' for nil. The name is now rejected when the converter is added:

ArgumentError: unknown converter name: :bogus (not in CSV::Converters)

A built-in converter and a custom proc still convert as before. The full suite: 537 tests, 0 failures.

An unknown converters or header_converters name was stored as nil and
failed later with NoMethodError on arity. The name is now rejected when
the converter is added.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unknown converter name is silently accepted and later fails with "undefined method 'arity' for nil"

1 participant